/*
Disclaimer of Warranty: THE PACKAGE IS PROVIDED
BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS'
AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT
ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW.
UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF
THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


(c) Copyright 2013 Edward Principe
All Rights Reserved

*/
#ifndef VARTYPE_H
#define VARTYPE_H

/////////////////////////////////////////////////////////////////
// VarType: Types of variables
/////////////////////////////////////////////////////////////////
enum VarType
{
	VARTYPE_SHORT,
	VARTYPE_USHORT,
	VARTYPE_INT,
	VARTYPE_UINT,
	VARTYPE_LONG,
	VARTYPE_ULONG,
	VARTYPE_FLOAT,
	VARTYPE_DOUBLE,
	VARTYPE_LONG_DOUBLE,
	VARTYPE_STRING,
	VARTYPE_CHAR,
	VARTYPE_BYTE,
	VARTYPE_TOKEN,
	VARTYPE_VARANT,
	VARTYPE_NONE=9999
};

/////////////////////////////////////////////////////////////////
// Byte lengths
/////////////////////////////////////////////////////////////////
#define VS_SHORT 8
#define VS_INT 32
#define VS_LONG 64
#define VS_FLOAT 32
#define VS_DOUBLE 64
#define VS_LONG_DOUBLE 128
#define VS_CHAR 16
#define VS_BYTE 8
#define VS_TOKEN 16

///////////////////////////////////////////////////////////////////
// Conversion Macros
////////////////////////////////////////////////////////////////////
#define BIT_TO_BYTE(x) (x) / 8
#define BYTE_TO_BIT(x) (x) * 8

////////////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////////////
typedef __int16 TYPE_HALF_WORD;
typedef __int32 TYPE_WORD;
typedef __int64 TYPE_DOUBLE_WORD;
typedef char TYPE_BOOL;
typedef TYPE_HALF_WORD TYPE_SHORT;
typedef TYPE_WORD TYPE_INT;
typedef float TYPE_FLOAT;
typedef double TYPE_DOUBLE;
typedef long double TYPE_LONG_DOUBLE;
typedef wstring TYPE_STRING;
typedef wchar_t TYPE_CHAR;
typedef char TYPE_BYTE;
typedef TYPE_HALF_WORD TYPE_TOKEN;
typedef void * TYPE_VARANT;

////////////////////////////////////////////////////////////////////
// Some common macros
/////////////////////////////////////////////////////////////////////
#define TYPE_NULL 0
#define TYPE_TRUE 1
#define TYPE_FALSE 0
#endif